﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ex03.GarageLogic
{
    public enum eStageOfTreatment
    {
        InRepair,
        Fixed,
        Payed
    }

    /// <summary>
    /// contain a Vehicle (and its eStageOfTreatment), m_OwnerPhoneNumber and m_OwnerName
    /// </summary>
    internal class VehicleInGarage
    {
        private eStageOfTreatment m_StageOfTreatment;
        private string m_OwnerName = null;
        private string m_OwnerPhoneNumber = null;
        private Vehicle m_Vehicle = null;

        public VehicleInGarage(Vehicle i_Vehicle) : this(null, null, i_Vehicle)
        {            
        }
        
        public VehicleInGarage(string i_OwnerName, string i_OwnerTelphoneNumber, Vehicle i_Vehicle)
        {
            m_StageOfTreatment = eStageOfTreatment.InRepair;            
            m_OwnerName = i_OwnerName;
            m_OwnerPhoneNumber = i_OwnerTelphoneNumber;
            m_Vehicle = i_Vehicle;
        }

        public eStageOfTreatment StageOfTreatment
        {
            get { return m_StageOfTreatment; }
            set { m_StageOfTreatment = value; }
        }
       
        public string OwnerName
        {
            get { return m_OwnerName; }
            set { m_OwnerName = value; }
        }

        public string OwnerPhoneNumber
        {
            get { return m_OwnerPhoneNumber; }
            set { m_OwnerPhoneNumber = value; }
        }
       
        public Vehicle Vehicle
        {
            get { return m_Vehicle; }
            set { m_Vehicle = value; }
        }

        /// <summary>
        /// Overriding <see cref="Object.ToString"/>
        /// </summary>
        /// <returns>string with VehicleInGarage properties (m_OwnerName, m_StageOfTreatment) and the ToString of its member m_Vehicle</returns>
        public override string ToString()
        {
            string toString = string.Empty;

            toString = string.Format(@"
Owner name: {0}
Vehicle State: {1}
{2}"
                , m_OwnerName
                , m_StageOfTreatment
                ,m_Vehicle);

            return toString;
        }
    }
}
